import pygame

win_x = 600
win_y = 685


class ChessPieces(object):
    def __init__(self, horde, value, x, y, new_window):
        self.pos = [x, y]
        self.horde = horde
        self.value = value
        self.actualvalue = value
        self.window = new_window
        self.changeche = False
        if horde:
            self.img = pygame.image.load("res/W0.png")
        if not horde:
            self.img = pygame.image.load("res/B0.png")
        self.exposure = False

    def blited(self, x, y):
        self.window.blit(self.img, (x, y))

    def expose(self):
        i = self.value
        print(i)
        if not self.horde:
            if i == 1:
                self.img = pygame.image.load("res/B1.png")
            if i == 2:
                self.img = pygame.image.load("res/B2.png")
            if i == 3:
                self.img = pygame.image.load("res/B3.png")
            if i == 4:
                self.img = pygame.image.load("res/B4.png")
            if i == 5:
                self.img = pygame.image.load("res/B5.png")
        elif self.horde:
            if i == 1:
                self.img = pygame.image.load("res/W1.png")
            if i == 2:
                self.img = pygame.image.load("res/W2.png")
            if i == 3:
                self.img = pygame.image.load("res/W3.png")
            if i == 4:
                self.img = pygame.image.load("res/W4.png")
            if i == 5:
                self.img = pygame.image.load("res/W5.png")
        print('暴露')

